import {createRouter , createWebHistory} from 'vue-router'
import Index from "../pages/Index.vue";
import Search from "../pages/search/SearchPage.vue";
import EditPage from "../pages/user/UserEditPage.vue";
import SearchResultPage from "../pages/search/SearchResultPage.vue";
import UserLoginPage from "../pages/user/UserLoginPage.vue";
import TeamAddPage from "../pages/team/TeamAddPage.vue";
import TeamUpdatePage from "../pages/team/TeamUpdatePage.vue";
import UserPage from "../pages/user/UserPage.vue";
import TeamPage from "../pages/team/TeamPage.vue";
import UserUpdatePage from "../pages/user/UserUpdatePage.vue";
import UserJoinTeamPage from "../pages/user/UserJoinTeamPage.vue";
import UserCreateTeamPage from "../pages/user/UserCreateTeamPage.vue";
import UserRegisterPage from "../pages/user/UserRegisterPage.vue";
import NearbyPage from "../pages/nearby/NearbyPage.vue";
import NearbyBlogAddPage from "../pages/nearby/NearbyBlogAddPage.vue";
import NearbyBlogDetail from "../pages/nearby/NearbyBlogDetailPage.vue";
import PartnerChatPage from "../pages/chat/PartnerChatPage.vue";

export const routes = [
    {path: '/', component: Index},
    {path: '/team', title: '寻找队伍', component: TeamPage},
    {path: '/team/add', title: '新建队伍', component: TeamAddPage},
    {path: '/team/update', title: '修改队伍', component: TeamUpdatePage},
    {path: '/search', title: '寻找伙伴', component: Search},
    {path: '/search/list', title: '匹配伙伴列表', component: SearchResultPage},
    {path: '/user', title: '个人信息', component: UserPage},
    {path: '/user/register', title: '注册', component: UserRegisterPage},
    {path: '/user/login', title: '登录', component: UserLoginPage},
    {path: '/user/update', title: '我的资料', component: UserUpdatePage},
    {path: '/user/edit', title: '编辑信息', component: EditPage},
    {path: '/user/join/team', title: '已加队伍', component: UserJoinTeamPage},
    {path: '/user/create/team', title: '已建队伍', component: UserCreateTeamPage},
    {path: '/nearby', title: '附近', component: NearbyPage},
    {path: '/nearby/blog/add', title: '发笔记', component: NearbyBlogAddPage},
    {path: '/nearby/blog/detail', title: '笔记详情', component: NearbyBlogDetail},
    {path: '/chat', title: '聊天', component: PartnerChatPage},
]

const router = createRouter({
    history: createWebHistory(), //设置为createWebHistory模式，跳转路由时就不会在地址栏上出现/#/这样的形式
    routes,
})

export default router;